<?php
namespace app\home\controller;

use cmf\controller\BaseController;
use think\Db;

class IndexController extends BaseController
{
    public function index()
    {
        $banner=Db::name('slide_item')->where("slide_id",3)->where('status',1)->order('list_order asc')->limit(0,3)->select();
        foreach ($banner as $k=>$v){
            $img="img".$k;
            $this->assign("{$img}",$v);
        }
        $category=Db::name("portal_category")->where("parent_id",0)->where('status',1)->select();
        $new=Db::name("portal_post")->where('post_type',3)->whereOr('post_type',4)->where('post_status',1)->limit(0,5)->select();
        $this->assign("new",$new);

        $this->assign("category",$category);
        return $this->fetch(":index");
    }
}
